/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.supplier;

import ejb.model.EJBModel;
import ejb.person.TelecomtypeBeanRemote;
import java.util.ArrayList;
import javax.ejb.EJB;
import javax.swing.DefaultComboBoxModel;
import util.person.TelecomtypeDetails;

/**
 *
 * @author Gebruiker
 */
public class TelecomtypeComboBoxModel extends DefaultComboBoxModel {
    
    @EJB
    private TelecomtypeBeanRemote ttbr;
    private ArrayList<TelecomtypeDetails> types;
    
    public TelecomtypeComboBoxModel(){
        types = new ArrayList<TelecomtypeDetails>();
        for(TelecomtypeDetails type:EJBModel.getTelecomtypeBean().getAllTelecomtypeDetails()){
            types.add(type);
        }
        
    }

    @Override
    public Object getSelectedItem() {
        return super.getSelectedItem();
    }

    @Override
    public int getSize() {
        return types.size();
    }

    @Override
    public Object getElementAt(int index) {
        return types.get(index).getName();
    }
    
    
    
}
